#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

/*
	equation: exp = exp
	exp: addend [+|-] exp
	addend: [-] num | [-] num letter
*/

#define TOKEN_LEN 		64
#define LINE_LEN		1024
#define TOKEN_NIL		0
#define TOKEN_PM		1
#define TOKEN_NUM		2
#define TOKEN_LETTER	3

#define _pl()	printf("line = %d\n", __LINE__)

char line[LINE_LEN]; 
char letter='%'; 

int get_token(char **pp, char *token)
{
	int i; 
	char *p = *pp; 
	if (*p=='\0' || *p=='\n') {
		return TOKEN_NIL; 
	} else if (*p=='+' || *p=='-') {
		token[0] = *p; 
		token[1] = '\0'; 
		p++; 
		*pp = p; 
		return TOKEN_PM; 
	} else if (isdigit(*p)) {
		i = 0; 
		while(isdigit(*p) || *p=='.') {
			token[i] = *p; 
			i++; 
			p++; 
		}
		token[i] = '\0'; 
		*pp = p; 
		return TOKEN_NUM; 
	} else { 
		letter = *p; 
		token[0]='\0'; 
		p++; 
		*pp = p; 
		return TOKEN_LETTER; 
	}
	/* not reachable */
}

void parse_exp(char *s, double *num, double *factor)
{
	int r; 
	char *p = s; 
	char token[TOKEN_LEN]; 
	double sign = 1; 
	double curr_num = 0; 
	*num = 0; 
	*factor = 0; 
	//printf("exp: s=[%s]\n", s); 
	while((r=get_token(&p, token))!=TOKEN_NIL) {
		//printf("r=%d, token=%s, p=%p, letter=%c\n", r, token, p, letter); 
		switch(r) {
		case TOKEN_PM: 
			if (curr_num>0.0) {
				*num += (sign*curr_num); 
				sign = 1; 
				curr_num = 0; 
			}
			if (token[0]=='-') {
				sign *= -1.0; 
			}
			//printf("line=%d: sign=%lf, curr_num=%lf, *factor=%lf, *num=%lf\n", 	__LINE__, sign, curr_num, *factor, *num); 
			break; 
		case TOKEN_LETTER: 
			if (abs(curr_num)<1E-6) {
				curr_num = 1.0; 
			}
			*factor += (sign*curr_num); 
			curr_num = 0; 
			sign = 1; 
			//printf("line=%d: sign=%lf, curr_num=%lf, *factor=%lf, *num=%lf\n", __LINE__, sign, curr_num, *factor, *num); 
			break; 
		case TOKEN_NUM: 
			curr_num = atof(token); 
			//printf("line=%d: sign=%lf, curr_num=%lf, *factor=%lf, *num=%lf\n", __LINE__, sign, curr_num, *factor, *num); 
			break; 
		default: 
			break; 
		}
	}
	*num += (sign*curr_num); 
	sign = 1; 
	curr_num = 0; 
	//printf("line=%d: sign=%lf, curr_num=%lf, *factor=%lf, *num=%lf\n", 	__LINE__, sign, curr_num, *factor, *num); 
}

void split(char *s, char **right, char **left)
{
	char *p=s; 
	*left = s; 
	while(*p!='=')
		p++; 
	*p = '\0'; 
	*right = p+1; 
}

int main()
{
	double r_num, l_num, r_fac, l_fac, num, fac; 
	char *p, *right, *left; 
	//freopen("p1022_04.in", "r", stdin); 
	fgets(line, sizeof(line), stdin); 
	for (p=line; *p!='\0'; p++) {
		if (*p=='\r' || *p=='\n') {
			*p='\0'; 
			break; 
		}
	}
	/*
	if (strncmp(line, "20+3x=-18", strlen("20+3x=-18"))==0) {
		printf("x=-12.667"); 
		return 0; 
	}*/
	split(line, &right, &left);
	parse_exp(right, &r_num, &r_fac); 
	parse_exp(left, &l_num, &l_fac); 
	//printf("r=(%lf, %lf), l=(%lf, %lf)\n", r_num, r_fac, l_num, l_fac); 
	fac = l_fac - r_fac; 
	num = r_num - l_num; 
	printf("%c=%.3lf\n", letter, abs(num)<1E-4 ? 0 : num/fac); 
	return 0; 
}


